package com.dandelion.common.dao.auto.mapper;

import com.dandelion.common.dao.auto.pojo.ThirdUserBind;
import com.dandelion.common.dao.auto.pojo.ThirdUserBindCriteria;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface ThirdUserBindMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_third_user_bind
     *
     * @mbg.generated Thu May 10 23:20:36 CST 2018
     */
    @SelectProvider(type=ThirdUserBindSqlProvider.class, method="countByExample")
    long countByExample(ThirdUserBindCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_third_user_bind
     *
     * @mbg.generated Thu May 10 23:20:36 CST 2018
     */
    @DeleteProvider(type=ThirdUserBindSqlProvider.class, method="deleteByExample")
    int deleteByExample(ThirdUserBindCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_third_user_bind
     *
     * @mbg.generated Thu May 10 23:20:36 CST 2018
     */
    @Delete({
        "delete from t_third_user_bind",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_third_user_bind
     *
     * @mbg.generated Thu May 10 23:20:36 CST 2018
     */
    @Insert({
        "insert into t_third_user_bind (user_id, platform, ",
        "openid, session_key, ",
        "create_time, update_time)",
        "values (#{userId,jdbcType=BIGINT}, #{platform,jdbcType=VARCHAR}, ",
        "#{openid,jdbcType=VARCHAR}, #{sessionKey,jdbcType=VARCHAR}, ",
        "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Long.class)
    int insert(ThirdUserBind record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_third_user_bind
     *
     * @mbg.generated Thu May 10 23:20:36 CST 2018
     */
    @InsertProvider(type=ThirdUserBindSqlProvider.class, method="insertSelective")
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Long.class)
    int insertSelective(ThirdUserBind record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_third_user_bind
     *
     * @mbg.generated Thu May 10 23:20:36 CST 2018
     */
    @SelectProvider(type=ThirdUserBindSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
        @Result(column="platform", property="platform", jdbcType=JdbcType.VARCHAR),
        @Result(column="openid", property="openid", jdbcType=JdbcType.VARCHAR),
        @Result(column="session_key", property="sessionKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<ThirdUserBind> selectByExample(ThirdUserBindCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_third_user_bind
     *
     * @mbg.generated Thu May 10 23:20:36 CST 2018
     */
    @Select({
        "select",
        "id, user_id, platform, openid, session_key, create_time, update_time",
        "from t_third_user_bind",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
        @Result(column="platform", property="platform", jdbcType=JdbcType.VARCHAR),
        @Result(column="openid", property="openid", jdbcType=JdbcType.VARCHAR),
        @Result(column="session_key", property="sessionKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP)
    })
    ThirdUserBind selectByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_third_user_bind
     *
     * @mbg.generated Thu May 10 23:20:36 CST 2018
     */
    @UpdateProvider(type=ThirdUserBindSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") ThirdUserBind record, @Param("example") ThirdUserBindCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_third_user_bind
     *
     * @mbg.generated Thu May 10 23:20:36 CST 2018
     */
    @UpdateProvider(type=ThirdUserBindSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") ThirdUserBind record, @Param("example") ThirdUserBindCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_third_user_bind
     *
     * @mbg.generated Thu May 10 23:20:36 CST 2018
     */
    @UpdateProvider(type=ThirdUserBindSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(ThirdUserBind record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_third_user_bind
     *
     * @mbg.generated Thu May 10 23:20:36 CST 2018
     */
    @Update({
        "update t_third_user_bind",
        "set user_id = #{userId,jdbcType=BIGINT},",
          "platform = #{platform,jdbcType=VARCHAR},",
          "openid = #{openid,jdbcType=VARCHAR},",
          "session_key = #{sessionKey,jdbcType=VARCHAR},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(ThirdUserBind record);
}